//
//  MXAddEquipmentTypeCell.m
//  HNBaseProject
//
//  Created by xujie on 2024/6/19.
//

#import "MXAddEquipmentTypeCell.h"

@implementation MXAddEquipmentTypeCell
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self createUI];
    }
    return self;
}
- (void)createUI {
    
    self.bgView = [[UIView alloc] init];
    self.bgView.layer.cornerRadius = 6;
    self.bgView.layer.masksToBounds = YES;
    self.bgView.backgroundColor = [UIColor colorWithHexString:@"#F3F3F3"];
    [self.contentView addSubview:self.bgView];
    [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.bottom.offset(0);
    }];
    
    self.icon = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"add_shebei"]];
    [self.bgView addSubview:self.icon];
    [self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(11);
        make.centerX.mas_equalTo(self.bgView);
        make.height.mas_equalTo(63);
        make.width.mas_equalTo(43);
    }];
    
    self.nameLab = [[UILabel alloc] init];
    self.nameLab.text = @"喵享家智能喂食器";
    self.nameLab.textAlignment = NSTextAlignmentCenter;
    self.nameLab.numberOfLines = 2;
    self.nameLab.textColor = [UIColor dc_colorWithHexString:@"#000000" alpha:0.7];
    self.nameLab.font = PFRFontMedium(11);
    [self.bgView addSubview:self.nameLab];
    [self.nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self);
        make.left.offset(5);
        make.right.offset(-5);
        make.top.mas_equalTo(self.icon.mas_bottom).offset(6);
    }];
    
}

- (void)reloadCellWithModel:(MXEquipmentTypeModel *)model {
    self.nameLab.text = model.categoryName;
}
@end
